import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useMachineInfoStore = defineStore(
  'machineInfo',
  () => {
    /**设备信息 */
    const machineInfo = ref()
    /**修改设备信息 */
    const setMachineInfo = (val) => {
      machineInfo.value = val
    }
    /**删除设备信息 */
    const deleteMachineInfo = () => {
      machineInfo.value = undefined
    }

    return { machineInfo, setMachineInfo, deleteMachineInfo }
  },
  {
    // 数据持久化
    persist: true,
  },
)
